import { useQuery } from "@tanstack/react-query"
import { getUserById } from "."
import type { UserGetByIdDto } from "@/types/user"

export const useUser = (params: UserGetByIdDto) => {
  return useQuery({
    queryKey: ["users", params.id],
    queryFn: () => getUserById(params),
    enabled: !!params.id
  })
}
